﻿using ForgottenTalez.GameStateManager.ScreenMan;
using ForgottenTalez.GameStateManager.Screens.ScreenItems;
using ForgottenTalez.Renderers;
using ForgottenTalez.Renderers.Interface;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace ForgottenTalez.GameStateManager.Screens.MenuScreens
{
    class MainMenuScreen: GameScreen
    {
        #region <<<Constructors>>>
        public MainMenuScreen(bool isPopup, IScreenRenderer ScreenRenderer)
            : base(ScreenRenderer) { this.IsPopup = isPopup; }
        #endregion

        #region Initialize
        public override void LoadContent()
        {
                ContentManager content = ScreenManager.Game.Content;

                {
                    Texture2D PlayTexture = content.Load<Texture2D>(@"GSMAssets\buttons\TestButton");
                    Button Button = new Button(new Vector2(150, 150), new CardButtonRenderer(ScreenManager, PlayTexture), "Play", new Vector2(60, 90));
                    Button.selectedEvent += PlayButtonSelected;
                    MenuButtons.Add(Button);
                }
                {
                    Texture2D PlayTexture = content.Load<Texture2D>(@"GSMAssets\buttons\TestButton");
                    Button Button = new Button(new Vector2(250, 150), new CardButtonRenderer(ScreenManager, PlayTexture), "Options", new Vector2(60, 90));
                    Button.selectedEvent += OptionsButtonSelected;
                    MenuButtons.Add(Button);
                }

            base.LoadContent();
        }
        #endregion

        #region Events
        public void PlayButtonSelected(Button sender)
        {
            sender.Position += new Vector2(10, 0);
        }

        public void OptionsButtonSelected(Button sender)
        {
            sender.Position += new Vector2(0, 10);
        }
        #endregion
    }
}
